package com.yuanfeng.business.feign;

import com.yuanfeng.business.vo.ManageExpressQueryVO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
@FeignClient(name = "mall-base", url = "http://localhost:8011")
public interface BaseServiceClient {


    /**
     * 根据configKey 查询配置 feign
     */
    @PostMapping("base/sysConfig/queryConfigKeyFeign")
    String selectConfigValueFeign(@RequestParam String configKey);

    /**
     * 根据configKey和configType查configValue
     *
     * @param configKey
     * @return
     */
    @GetMapping("/base/sysConfig/selectByKeyAndType")
    ResponseResult getConfigValue(@RequestParam("configKey") String configKey,
                                  @RequestParam("configType") String configType);


    /**
     * 查询地区
     * @param provinceId
     * @return
     */
    @PostMapping("/base/district/queryProvinceport")
     String queryProvinceport(@RequestParam("provinceId") String provinceId);


    /**
     * 得到地址信息
     *
     * @param provinceId
     * @param cityId
     * @param districtId
     * @return
     */
    @GetMapping("/base/district/getAddressString")
    ResponseResult getAddressString(@RequestParam("province") Integer provinceId, @RequestParam("city") Integer cityId,
                            @RequestParam("county") Integer districtId);


    /**
     * 查询地区名称
     * @return
     */
    @PostMapping(value = "/base/district/query/district/name")
    public List<String> queryDistrictName(@RequestBody List<Integer> districtIds);

    /**
     * 查询快递公司
     *
     * @return
     */
    @PostMapping("/base/express/query/noTokenTwo")
    public List<ManageExpressQueryVO> queryNoTokenTwo();

    /**
     * 根据区域id集合查找区域名字集合
     *
     * @param districtIds
     * @return
     */
    @PostMapping("/base/district/query/district/name")
    List<String> selectDistrictNameListByIds(@RequestBody List<Integer> districtIds);

    /**
     * 修改分销商申请信息(店铺名)
     *
     * @param map
     * @return
     */
    @PostMapping("/base/dealerApplyInfo/updateDealerApplyInfo")
    ResponseResult updateDealerApplyInfotByMap(@RequestBody Map<String, Object> map);
}
